<template>
    <div class="HYJJFA_wraper">
        <div class="wrap">
            <div class="header">
                <span class="icon"></span>
                <span class="title">{{ $t('p3.tab1.title') }}</span>
            </div>

            <div class="content">
                <div class="left">
                    {{ $t('p3.tab1.desc') }}
                </div>

                <div class="right">
                    <img :src="HYJJFA_1" alt="" v-if="language === 'jp'">
                    <img :src="HYJJFA" alt="" v-else>
                </div>
            </div>

            <div class="content_items_wrap">
                <div class="box" v-for="item in dataList">
                    <div class="title">
                        <span class="icon"></span>
                        <span class="text">{{ item.name }}</span>
                    </div>
                    <div class="desc">
                        {{ item.description }}
                    </div>
                    <div class="bto_more_wrap">
                        <template v-for="item in item.productList">
                            <router-link target="_blank" :to="`${item.href ? item.href : '/HYJJFA_Detail?id=${item.id}'}`">
                                <div class="item_bto">
                                    <div class="text">{{ item.title }}</div>
                                </div>
                            </router-link>
                        </template>
                    </div>
                </div>
            </div>



        </div>
    </div>
</template>
<script>
import HYJJFA from '@/assets/images/wi/HYJJFA.png'
import HYJJFA_1 from '@/assets/images/wi/HYJJFA_1.png'
import { getStore } from '@/libs'
export default {
    name: "index",
    components: {

    },
    data() {
        return {
            HYJJFA,HYJJFA_1,
            params: null,

            dataList: [],
            language: 'zh'
        }
    },

    created() {
        this.language = getStore({name: 'language'});
        this.params = this.$route.query

        this.getDataList()
    },
    methods: {
        /**
         * 获取新闻数据
         */
        async getDataList() {
            let terminal = 1
            let country = 1

            // 切换语言
            if(getStore({name: 'language'}) === 'jp') {
                country = 2
            }
            const res = await this.$http({
                url: '/api/siteproductcate/list',
                method: 'GET',
                params: {status: 1, sortColumns: 'sort', sortType: 'DESC', terminal, country}
            })
            if (this.ResultMessage(res, false)) {
                this.dataList = res.data || []
            }
        },
    }
};
</script>


<style lang="scss" scope>
.HYJJFA_wraper{
    color: #333333;
    display: flex;
    justify-content: center;
    padding: 0 20px;
    .wrap{
        width: 1080px;
        .header{
            display: flex;
            align-items: center;
            margin-top: 50px;
            span.icon{
                display: block;
                width: 5px;
                height: 35px;
                background-color: #98000A;
                border-right: 2px solid #FCA400;
            }
            span.title{
                font-size: 28px;
                font-weight: bold;
                margin-left: 10px;
            }
        }
        .content{
            display: flex;
            flex-direction: column;
            margin-top: 20px;
            .left{
                display: flex;
                background: #fff;
                flex: 5;
                padding: 20px;
            }
            .right{
                display: flex;
                flex: 1 300px;
                justify-content: center;
                img{
                    width: 100%;
                }
            }
        }

        .content_items_wrap{
            margin-top: 50px;
            .box{
                display: flex;
                flex-direction: column;
                margin-bottom: 20px;

                .title{
                    display: flex;
                    align-items: center;
                    span.icon{
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        width: 25px;
                        height: 25px;
                        margin-right: 10px;
                        background-image: url('../../assets/images/wi/bbox.png');
                        background-size: 100% 100%;
                        color: #98000A;
                        font-weight: bold;
                    }
                    span.text{
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        padding: 5px;
                        font-size: 22px;
                        font-weight: bold;
                    }
                }

                .desc{
                    font-size: 22px;
                    padding-top: 5px;
                    margin-left: 42px;
                }

                .bto_more_wrap{
                    display: flex;
                    flex-wrap: wrap;
                    padding-top: 20px;
                    .item_bto{
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        border-radius: 20px;
                        margin-right: 20px;
                        margin-bottom: 10px;
                        margin-left: 42px;
                        .text{
                            margin-right: 10px;
                            color: #98000A;
                            font-size: 22px;
                        }
                        .icon{
                            width: 20px;
                            height: 25px;
                            display: flex;
                            align-items: center;
                            justify-content: center;
                            background-image: url('../../assets/images/wi/RR1.png');
                            background-repeat: no-repeat;
                            background-position: center center;

                        }
                    }
                }
            }
        }

    }
}
</style>
